Ubuntu 15.04
Sponsored Link

Enable Userdir
2015/05/25
 
Enable userdir, users can build websites with this config.
[1] Configure Apache2 for Userdir.
root@www:~#
a2enmod userdir

Enabling module userdir.
To activate the new configuration, you need to run:
  service apache2 restart

root@www:~#
vi /etc/apache2/mods-enabled/userdir.conf
# line 6,7: change

AllowOverride
All

Options
ExecCGI
root@www:~#
vi /etc/apache2/mods-enabled/php5.conf
# line 23: comment out

#
php_admin_flag engine Off
root@www:~#
systemctl restart apache2

[2] Create a CGI test page with a user and access to it with web browser. It's OK if following page is shown.
vervet@www:~$
mkdir public_html

vervet@www:~$
vi public_html/index.cgi
#!/usr/bin/perl

print "Content-type: text/html\n\n";
print "<html>\n<body>\n";
print "<div style=\"width: 100%; font-size: 40px; font-weight: bold; text-align: center;\">\n";
print "Userdir Test Page";
print "\n</div>\n";
print "</body>\n</html>\n";

jessie@www:~$
chmod 705 public_html/index.cgi

[3] Create a PHP test page with a user and access to it with web browser. It's OK if following page is shown.
vervet@www:~$
vi public_html/index.php
<html>
<body>
<div style="width: 100%; font-size: 40px; font-weight: bold; text-align:center;">
User's Home<br />
<?php
    print Date("Y/m/d");
?>
</div>
</body>
</html>
 
Tweet